package 力扣.设计;

public class 设计停车系统1603 {
    private Integer[] car = new Integer[6];
    public 设计停车系统1603(int big, int medium, int small) {
         this.car[0] = big;
         this.car[4] = medium;
         this.car[5] = small;
    }

    public boolean addCar(int carType) {
        if (carType == 1){//big
           if (car[0] > 0){
               car[0]--;
           }else {
               return  false;
           }
        }else if (carType == 2){
            if (car[4] > 0){
                car[4]--;
            }else {
                return  false;
            }
        }else if (carType == 3){
            if (car[5] > 0){
                car[5]--;
            }else {
                return  false;
            }
        }
        return false;
    }
}
